<template>
  <div style="overflow: hidden">
    <div class="floatl">
      <h1 style="margin-bottom:0px" class="ml-1">
        {{ setting.options.title }}
        <a class="ml-2" style="font-size: 16px">{{  setting.options.subtitle }}</a>
      </h1>
    </div>
    <div style="line-height: 50px" class="floatr">
      <a-breadcrumb v-show="setting.options.Breadcrumb">
        <a-breadcrumb-item v-for="item in currentRouteList" :key="item.path">
          <a @click="routeJump(!!item.redirect ? item.redirect : item.path)">
            {{ item.meta.title }}
          </a>
        </a-breadcrumb-item>
      </a-breadcrumb>
    </div>
  </div>
</template>
<script>
  import {  getCurrentInstance } from 'vue'
  import { useRouter } from 'vue-router';
  export default {
    props: ['setting'],
    setup() {
      const { ctx } = getCurrentInstance() //获取当前路由
       const router = useRouter();
      let currentRouteList = ctx.$router.currentRoute.value.matched
      console.log('ctx.$router.currentRoute.value.matched',ctx.$router.currentRoute.value.matched)
       
      const routeJump = (routeVal) =>{
        console.log('routeVal',routeVal)
        router.push({
          path:routeVal,
        });
      }
      return {
        currentRouteList,
        routeJump
      }
    },
  }
</script>
